package org.itboys.core.util;

import com.alibaba.fastjson.JSONObject;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * 作者：zzq
 * 时间：2018/3/10
 * 描述：
 */
public class JsonUtil {
    public static JSONObject map2Json(Map<String,Object> map){
        JSONObject json = new JSONObject();
        Set<String> set = map.keySet();
        for (Iterator<String> it = set.iterator(); it.hasNext();) {
            String key = it.next();
            json.put(key, map.get(key));
        }
        return json;
    }
}
